$(function(){
	/** ******************************************* */
	$("#sp_left1").click(function() {
		$("#sp_left1")
				.html("<img src='/image/img/sp_p2.jpg' width='60' height='80'/>");
		$("#sp_left2")
				.html("<a href='javascript:findMvBySort(2)'><img src='/image/img/sp_hot1.jpg' width='60' height='80'/></a>");
		$("#sp_left3")
				.html("<a href='javascript:findMvBySort(3)'><img src='/image/img/sp_new1.jpg' width='60' height='80'/></a>");
		$("#sp_left4")
				.html("<a href='javascript:findMvBySort(4)'><img src='/image/img/sp_p3.jpg' width='60' height='80'/></a>");
	});
	$("#sp_left2").click(function() {
		$("#sp_left2")
				.html("<img src='/image/img/sp_hot2.jpg' width='60' height='80'/>");
		$("#sp_left1")
				.html("<a href='javascript:findMvBySort(1)'><img src='/image/img/sp_p1.jpg' width='60' height='80'/></a>");
		$("#sp_left3")
				.html("<a href='javascript:findMvBySort(3)'><img src='/image/img/sp_new1.jpg' width='60' height='80'/></a>");
		$("#sp_left4")
				.html("<a href='javascript:findMvBySort(4)'><img src='/image/img/sp_p3.jpg' width='60' height='80'/></a>");
	});
	$("#sp_left3").click(function() {
		$("#sp_left3")
				.html("<img src='/image/img/sp_new2.jpg' width='60' height='80'/>");
		$("#sp_left2")
				.html("<a href='javascript:findMvBySort(2)'><img src='/image/img/sp_hot1.jpg' width='60' height='80'/></a>");
		$("#sp_left1")
				.html("<a href='javascript:findMvBySort(1)'><img src='/image/img/sp_p1.jpg' width='60' height='80'/></a>");
		$("#sp_left4")
				.html("<a href='javascript:findMvBySort(4)'><img src='/image/img/sp_p3.jpg' width='60' height='80'/></a>");
	});
	$("#sp_left4").click(function() {
		$("#sp_left4")
				.html("<img src='/image/img/sp_p4.jpg' width='60' height='80'/>");
		$("#sp_left3")
				.html("<a href='javascript:findMvBySort(3)'><img src='/image/img/sp_new1.jpg' width='60' height='80'/></a>");
		$("#sp_left2")
				.html("<a href='javascript:findMvBySort(2)'><img src='/image/img/sp_hot1.jpg' width='60' height='80'/></a>");
		$("#sp_left1")
				.html("<a href='javascript:findMvBySort(1)'><img src='/image/img/sp_p1.jpg' width='60' height='80'/></a>");
	});

	findSpecial(1,1);
	
});

function findMvBySort(flag){
	findSpecial(1,flag);
}

/**
 * 加载专辑
 */
function findSpecial(pageNum, type){
	$.get(path+"/song/special/page-list",{"pageNum":pageNum,"pageSize":10,"type":type},function(result){
		$("#sp_right").empty();
		if (result.code === 200) {
			var list=result.list;
			$(list).each(function(){
				var div='<div id="sp_right1"><div id="sp_shead"><a href="/sites/specialone.html?specialid='+this.id+'"><img src="'+this.headImg+'" width="100" height="100"/></a></div><div id="sp_swrite"><span id="sp_span1">'+this.specialName+'</span><br/><span id="sp_span2">'+this.specialName+'</span><br /> <span id="sp_span3">收藏:'+this.heat+'</span></div></div>';
				$("#sp_right").append(div);
				$("#sp_right div:last").data("special", this);
			});
		} else {
			alert(result.msg);
		}
	});
}

